#pragma once

#include "kernel/domain/map_types.h"
#include <QList>
#include <QString>

namespace kernel {

struct MapStationExtension {
    QString mapName;
    QString stationName;
    StationType stationType{StationType::Normal};
};

struct LiftFloorConfig {
    int floor{0};
    QString mapName;
    QString askPoint;
    QString waitPoint;
    QString interPoint;
};

struct LiftConfig {
    int liftNum{0};
    QString liftType;
    bool agvControl{false};
    QString liftIp;
    int liftPort{0};
    QString baseUrl;
    QString liftCode;
    QString username;
    QString password;
    QList<LiftFloorConfig> floorInfo;
};

struct CallerConfig {
    int callerNum{0};
    QString taskName;
};

struct ThirdAreaConfig {
    QString areaId;
    int floor{0};
    bool isLiftResource{false};
    int liftNum{0};
};

struct AutoDoorConfig {
    int doorId{0};
    quint32 deviceId{0};     // 硬件设备ID（4字节，对应LED控制协议中的DeviceId）
    int floor{0};
    QString point1;          // 触发点1
    QString point2;          // 触发点2
    quint8 openMask{0x07};   // 开门LED掩码（默认0b111全开）
    quint8 closeMask{0x00};  // 关门LED掩码（默认0b000全关）
};

struct ChargeStationConfig {
    QString pointId;
    QString stationPoint;
    QString actionPoint;
    QString areaId;
    QList<int> assignedAgvNumbers;
    QList<int> blockedAgvNumbers;
    QList<QString> supportedAgvTypes;
    int floor{0};
};

struct ParkStationConfig {
    QString pointId;
    QString stationPoint;
    QString areaId;
    int floor{0};
};

struct MapExtendedData {
    QList<MapStationExtension> stationExtensions;
    QList<LiftConfig> lifts;
    QList<CallerConfig> callers;
    QList<ThirdAreaConfig> thirdAreas;
    QList<AutoDoorConfig> autoDoors;
    QList<ChargeStationConfig> chargeStations;
    QList<ParkStationConfig> parkStations;
};

}  // namespace kernel
